package com.wuuxiang.polestar.core.spring.surpass;

import com.wuuxiang.polestar.core.zookeeper.surpass.ZookeeperSurPassConfigGroup;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.w3c.dom.Element;

/**
 * 项目名称：polestar        <br>
 * 类描述：                         <br>
 * 创建人：夏鸿鹏                    <br>
 * 创建时间：2017-12-5 17:22        <br>
 * 修改备注：                        <br>
 */

public class ZookeeperSurPassConfigGroupConfigBean extends AbstractSingleBeanDefinitionParser {
    @Override
    protected Class<?> getBeanClass(Element element) {
        return ZookeeperSurPassConfigGroup.class;
    }

    @Override
    protected void doParse(Element element, BeanDefinitionBuilder builder) {
        String configProfileRef = element.getAttribute("config-profile-ref");
        builder.addConstructorArgReference(configProfileRef);
        String node = element.getAttribute("node");
        builder.addConstructorArgValue(node);
    }
}
